package com.ama.dao;


import com.ama.pojo.Person;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface PersonDao extends BaseMapper<Person> {
	public void savePerson(Person person);

	/**
	 * QueryWrapper wrapper = new QueryWrapper();
	 * wrapper.eq("name",person.getName());
	 * Person p = personDao.selectOne(wrapper);
	 *取代
	 * public Person findPersonByName(String username);
	 */
	//public Person findPersonByName(String username);



	public Person findPersonByNameAndPassword(@Param("username")String  username, @Param("password") String password);

	/**
	 * personDao.updateById(person);
	 * 取代
	 * public void updatePerson(Person person);
	 */
	//public void updatePerson(Person person);

	/**
	 * personDao.updateById(person);
	 * 取代
	 * person.setPubTime(newDate())
	 * public void udpatePubtime(Person person);
	 */
	//public void udpatePubtime(Person person);

	/**
	 * personDao.updateById(person);
	 * 取代
	 * public void ZeroPubtime(Person person);
	 * @param person
	 */
	//public void ZeroPubtime(Person person);

	/**
	 * personDao.selectList(null);
	 * 取代
	 * public List<Person> findAllPersons();
	 */
	//public List<Person> findAllPersons();

	/**
	 * List<Person> persons = personDao.selectByMap(map);
	 * 取代
	 * List<Person> persons = personDao.findPersonsByParams(map);
	 */
	//public List<Person> findPersonsByParams(Map<String, String> map);

	/**
	 * personDao.selectById(id)
	 * 取代
	 * public Person findPersonById(long id);
	 */
	//public Person findPersonById(long id);
}
